﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Drawing;

namespace MvcCarConsume.Controllers
{
    /*
    public class picshowController : Controller
    {
        public ActionResult image(int id)
        {
            using (var db = new MvcCarConsume.Domain.Entites.MvcCarDBEntities())
            {
                var car = db.Car.Single(a => a.BrandId == id);
                if (car != null)
                {
                    if (car.Image == null)
                    {
                        return new WebUI.ImageResult();
                    }
                    var buffer = car.Image.ToArray();
                    ImageConverter ic = new ImageConverter();
                    var image = (Image)ic.ConvertFrom(buffer);
                    return new WebUI.ImageResult()
                    {
                        Image = image,
                        ImageFormat = System.Drawing.Imaging.ImageFormat.Jpeg
                    };
                }
                else
                    return View();
            }
        }

    }
     * */
}
